import request from '@/utils/request'
export default{
  // 查询章节列表
  getNestedTreeList(courseId) {
    return request({
      url: `/admin/edu/chapter/nested-list/${courseId}`,
      method: 'get'
    })
  },
  // 根据id删除章节
  removeById(id) {
    return request({
      url: `/admin/edu/chapter/remove/${id}`,
      method: 'delete'
    })
  },
  // 新增章节
  save(chapter) {
    return request({
      url: '/admin/edu/chapter/save',
      method: 'post',
      data: chapter
    })
  },
  // 根据id获取章节
  getById(id) {
    return request({
      url: `/admin/edu/chapter/get/${id}`,
      method: 'get'
    })
  },
  // 根据id修改章节
  updateById(chapter) {
    return request({
      url: '/admin/edu/chapter/update',
      method: 'put',
      data: chapter
    })
  }
}
